//
//  UIButton+NEDSet.m
//  NEDCategory
//
//  Created by 98du on 2021/12/6.
//

#import "UIButton+NEDSet.h"
#import "UIFont+NED.h"

@implementation UIButton (NEDSet)

- (UIButton *(^)(NSAttributedString * attTitle))nedAttTitle{
    UIButton *(^block)(NSAttributedString * attTitle) = ^UIButton *(NSAttributedString * attTitle) {
        [self setAttributedTitle:attTitle forState:UIControlStateNormal];
        return self;
    };
    return block;
}
- (UIButton *(^)(NSAttributedString * attTitle))nedAttTitleSelect{
    UIButton *(^block)(NSAttributedString * attTitle) = ^UIButton *(NSAttributedString * attTitle) {
        [self setAttributedTitle:attTitle forState:UIControlStateSelected];
        return self;
    };
    return block;
}


- (UIButton *(^)(NSString * title))nedTitle{
    UIButton *(^block)(NSString * title) = ^UIButton *(NSString * title) {
        [self setTitle:title forState:(UIControlStateNormal)];
        return self;
    };
    return block;
}
- (UIButton *(^)(NSString * title))nedTitleSelect{
    UIButton *(^block)(NSString * title) = ^UIButton *(NSString * title) {
        [self setTitle:title forState:(UIControlStateSelected)];
        return self;
    };
    return block;
}

- (UIButton *(^)(CGFloat fontSize))nedFont{
    UIButton *(^block)(CGFloat fontSize) = ^UIButton *(CGFloat fontSize) {
        self.titleLabel.font = [UIFont ned_pfOfSize:fontSize];
        return self;
    };
    return block;
}

- (UIButton *(^)(CGFloat fontSize))nedFontM{
    UIButton *(^block)(CGFloat fontSize) = ^UIButton *(CGFloat fontSize) {
        self.titleLabel.font = [UIFont ned_pfmOfSize:fontSize];
        return self;
    };
    return block;
}


- (UIButton *(^)(UIColor * color))nedTitleColor{
    UIButton *(^block)(UIColor * color) = ^UIButton *(UIColor * color) {
        [self setTitleColor:color forState:(UIControlStateNormal)];
        return self;
    };
    return block;
}
- (UIButton *(^)(UIColor * color))nedTitleColorSelect{
    UIButton *(^block)(UIColor * color) = ^UIButton *(UIColor * color) {
        [self setTitleColor:color forState:(UIControlStateSelected)];
        return self;
    };
    return block;
}
- (UIButton *(^)(UIColor * color))nedBackgroundColor{
    UIButton *(^block)(UIColor * color) = ^UIButton *(UIColor * color) {
        [self setBackgroundColor:color];
        return self;
    };
    return block;
}




@end
